GOLF = (function() {
	 
			init = function() {
				slideimg();
				slidewrap();
				aboutslidewrap();
				s_nav();
			},

			slideimg = function() {
				$('#slides').slidesjs({
			        width: 940,
			        height: 345,
			        play: {
			          active: true,
			          auto: true,
			          interval: 4000,
			          swap: true
			        }
			      });
			},
			s_nav = function() {
				$('.s_nav li a').click(function(){
					$('.s_nav li a').removeClass("s_n_active");
					var tab=$(this).attr("tab");
					$(this).addClass("s_n_active");
					var id="#"+tab;
					$(".s_wrap").removeClass("s_active");
					$(id).addClass("s_active");
				});
			},
			//about页面滚动条
			aboutslidewrap=function(){
							// -------------------------------------------------------------
							//   Crazy
							// -------------------------------------------------------------
						
								var $frame  = $('#crazy');
								var $slidee = $frame.children('ul').eq(0);
								var $wrap   = $frame.parent();

								// Call Sly on frame
								$frame.sly({
									horizontal: 1,
									itemNav: 'basic',
									smart: 1,
									activateOn: 'click',
									mouseDragging: 1,
									touchDragging: 1,
									releaseSwing: 1,
									startAt: 3,
									scrollBar: $wrap.find('.scrollbar'),
									scrollBy: 1,
									pagesBar: $wrap.find('.pages'),
									activatePageOn: 'click',
									speed: 300,
									elasticBounds: 1,
									easing: 'easeOutExpo',
									dragHandle: 1,
									dynamicHandle: 1,
									clickBar: 1,

									
								});

			}

			//首页滚动条
			slidewrap=function(){
				var $frame = $('#oneperframe');
				var $wrap  = $frame.parent();

				// Call Sly on frame
				$frame.sly({
					horizontal: 1,
					itemNav: 'forceCentered',
					smart: 1,
					activateMiddle: 1,
					mouseDragging: 1,
					touchDragging: 1,
					releaseSwing: 1,
					startAt: 0,
					scrollBar: $wrap.find('.scrollbar'),
					scrollBy: 1,
					speed: 300,
					elasticBounds: 1,
					easing: 'easeOutExpo',
					dragHandle: 1,
					dynamicHandle: 1,
					clickBar: 1,

					// Buttons
					prev: $wrap.find('.prev'),
					next: $wrap.find('.next')
				});
				
			};
	
	return {
		init : init
		
	};
})();

GOLF.init();
